<template>
    <div class="mod-config">
    <basic-container>
      <div class="avue-crud">
        <el-table :data="dataList" stripe tooltip-effect="light" ref="tableRef">
            <el-table-column type="selection" width="55" header-align="center" align="center"></el-table-column>
            <el-table-column prop="normLx" label="指标类型" min-width="150">
            </el-table-column>
            <el-table-column prop="normName" label="指标名称" min-width="150" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="normDw" label="指标单位" min-width="150">
            </el-table-column>
            <el-table-column prop="normSm" show-overflow-tooltip label="指标说明" min-width="300">
            </el-table-column>
            <el-table-column prop="normPx" label="指标序号" min-width="100">
            </el-table-column>
        </el-table>
        <!-- <div class="avue-crud__pagination">
            <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
                            :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage" background
                            layout="total, sizes, prev, pager, next, jumper">
            </el-pagination>
        </div> -->
    </div>
    </basic-container>
  </div>
</template>
<script>
    import { fetchList } from '@/api/hetongrenwu/zhibiaoTable'

    export default {
        data() {
            return {
                dataList: [],
                pageIndex: 1,
                pageSize: 10,
                totalPage: 0,
            }
        },
        props:{
            hetongId: Number,
        },
        methods: {
            // 获取数据列表
            getDataList() {
                fetchList("htrw_zb").then(response => {
                    this.dataList = response.data.data
                })
            },
            // 每页数
            sizeChangeHandle(val) {
                this.pageSize = val
                this.pageIndex = 1
                this.getDataList()
            },
            // 当前页
            currentChangeHandle(val) {
                this.pageIndex = val
                this.getDataList()
            },
            saveZhibiao(){
                const rows = this.$refs.tableRef.selection
                if(rows.length < 1){
                    this.$message.closeAll();
                    this.$message({
                            type: 'info',
                            message: '请选择指标添加'
                        });
                }else{
                    this.$emit('func',rows)
                }
            }
        }
    }
</script>
